home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl -U
- # Perl script by Matt Mankins December 11 1994
- # Modified May 95 burt rosenberg: to put newest entries first.
-
- $wdir = "/export/httpd/htdocs/web/visitorlog/" ;
- $ipath = "/images";
- $quote='"';
-
- print "Content-type: text/html\n\n";
-
- if ($ENV{"WWW_name"})
- {
- print $wdir . "visitors.html";
- open (V, $wdir . "visitors.html") || die print "No can do on V.";
- open (W, ">" . $wdir . "visitors.tmp") || die print "No can do on W.";
- while (<V>)
- {
- print W $_ ;
- /Top-of-book/ && last ;
- }
-
- # $DATE = localtime(time);
-
- print W "<B>",`date`,"</B><P>\n";
- print W "<I>Name</I> : ",$ENV{"WWW_name"},"<P>\n";
-
- if ($ENV{"WWW_email"})
- {
- print W "<I>Email</I> : ",$ENV{"WWW_email"},"<P>\n";
- }
- if ($ENV{"WWW_comment"})
- {
- print W "<I>Comment</I>: ",$ENV{"WWW_comment"},"<P>";
- }
- print W "<hr>\n";
- while (<V>) {
- print W $_ ;
- }
- close V;
- close W;
- rename ( $wdir . "/visitors.tmp", $wdir . "/visitors.html") ;
- chmod 0664, $wdir . "/visitors.html" ;
-
- print "<TITLE>Visitor's Book Signed!</TITLE>";
- print "<H2>Visitor's Book Signed!</H2>\n";
- print "<IMG SRC=",$quote,"$ipath/visitors.gif",$quote,"><hr>\n";
- print "<B>",`date`,"</B><P>\n";
- print "<I>Name</I> : ",$ENV{"WWW_name"},"<P>\n";
- print "<I>Email</I> : ",$ENV{"WWW_email"},"<P>\n";
- print "<I>Comment</I>: ",$ENV{"WWW_comment"},"<P>\n";
- print "<hr><a href=",$quote,"/web/visitorlog/visitors.html",$quote,">View</a>\n";
- print "visitor's book\n";
- }
- else
- {
- print "<TITLE>No Name Added!</TITLE>\n";
- print "<H2>No Name Added!</H2>\n";
- print "<B>You must supply a name to be added to the visitor's book.</B>";
- print '<P><a href="/web/book.htm">Try again.</a>';
- }
-